/*class Task
{
	public var tasknum : Int;
	public var done : Bool;
	
	public static var urlloader = new flash.net.URLLoader();
	
	public static var curtask : Task = new Task(task_empty);

	public static inline var task_empty = -1;
	public static inline var task_uploadgame = 0;
	public static inline var task_downloadgame = 1;
	public static inline var task_downloadnumber = 2;
	
	public function new(tasknum : Int)
	{
		this.tasknum = tasknum;
		this.done = false;
	}
	
	public function dotask()
	{
		if (done) 
		{
			return;
		}
		else

					// I should attach events to the request?
					// the events go back into FileClient
					// I shouldn't load here, I should create a fileclient
					// with the loader
					// the downloadgame task needs to grab the desired id
		{
			switch(tasknum)
			{
				default:
					done = true;
				case(task_uploadgame):
					var newrec = new Recording();
					newrec.assign(rules.RulesAPI.record,
							 FlashClient.mainmenu.nametext_submit.text,
							 FlashClient.mainmenu.grouptext_submit.text,
							 rules.RulesAPI.g.seed);
					var req = new flash.net.URLRequest(
						"http://"+FlashNetworkClient.host+":"+FlashNetworkClient.port+
						"/creepweb.n?cmd=storerecord");
					req.method = flash.net.URLRequestMethod.POST;
					req.data = haxe.Serializer.run(newrec);
					urlloader.load(req);
				case(task_downloadgame):
					FileClient.client.indata = new StringBuf();
					var req = new flash.net.URLRequest(
						"http://"+FlashNetworkClient.host+":"+FlashNetworkClient.port+
						"/creepweb.n?cmd=getrecord&id=1");
					urlloader.load(req);
				case(task_downloadnumber):
					FileClient.client.indata = new StringBuf();
					var req = new flash.net.URLRequest(
						"http://"+FlashNetworkClient.host+":"+FlashNetworkClient.port+
						"/creepweb.n?cmd=dailygame");
					urlloader.load(req);
				
			}
		}
		return;
	}
	
}*/

